package models;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import play.data.validation.Required;
import play.db.jpa.Model;
import utils.models.CloneableForJSON;

@Entity
public class Comment extends Model implements CloneableForJSON<Comment>{
	@Required
	public String title;
	
	@Required
	public String content;
	
	@Required
	@ManyToOne(optional = false)
	public Post post;

	@Override
	public Comment cloneForJSON() {
		Comment clonedComment = new Comment();
		clonedComment.title = this.title;
		clonedComment.content = this.content;
		return clonedComment;
	}
}
